using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.Page
{
	public class RegByPhoneStepVoiceLangSelect : BasePage
	{
		private const string constLangVoice = "zh-TW:中文（國語）:+886,zh-HK:中文（廣東話）:852,en:English:0,ja:日本語:81,ko:한국어:0,th:ภาษาไทย:0,vi:Tiếng Việt:0,id:Bahasa Indonesia:0,pt:Português:0";
		private DlgSelectVoiceLang mCompleted;
		private string mDefaultSelect;
		internal Grid LayoutRoot;
		internal Grid sencondRoot;
		internal panelTitle2Line panelTitle;
		internal StackPanel LangListPanel;
		private bool _contentLoaded;
		public RegByPhoneStepVoiceLangSelect()
		{
			this.InitializeComponent();
			this.initConstLangVoiceMap();
		}
		private void initConstLangVoiceMap()
		{
			string[] array = "zh-TW:中文（國語）:+886,zh-HK:中文（廣東話）:852,en:English:0,ja:日本語:81,ko:한국어:0,th:ภาษาไทย:0,vi:Tiếng Việt:0,id:Bahasa Indonesia:0,pt:Português:0".Split(new char[]
			{
				','
			});
			string[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				string lang = array2[i];
				this.initLangItem(lang);
			}
		}
		protected override void OnPageIn(object[] object_0)
		{
			if (object_0 != null && 2 == object_0.Length && object_0[0].GetType() == typeof(string))
			{
				if (object_0[1].GetType() == typeof(DlgSelectVoiceLang))
				{
					this.mDefaultSelect = (object_0[0] as string);
					this.mCompleted = (object_0[1] as DlgSelectVoiceLang);
					return;
				}
			}
		}
		protected override void OnPageOut()
		{
		}
		private void langItemClick(object sender, string langName, string langCode)
		{
			if (this.mCompleted != null)
			{
				this.mCompleted(langName, langCode);
			}
			base.GoBack();
		}
		private void initLangItem(string lang)
		{
			VoiceLangItem voiceLangItem = new VoiceLangItem(lang);
			voiceLangItem.ItemClick += new VoiceLangItem.ListItemClick(this.langItemClick);
			this.LangListPanel.get_Children().Add(voiceLangItem);
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/LoginViews/RegByPhoneStepVoiceLangSelect.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.sencondRoot = (Grid)base.FindName("sencondRoot");
			this.panelTitle = (panelTitle2Line)base.FindName("panelTitle");
			this.LangListPanel = (StackPanel)base.FindName("LangListPanel");
		}
	}
}
